
/* eslint-disable no-shadow */
const base = 'cbv.applications';
export function count({ search }) {
  return RSocket.rr({
    route: `${base}.count`,
    args: { search },
  });
}

export function search({ search, pg }) {
  return RSocket.rs({
    route: `${base}`,
    args: { search, pg },
  });
}

export function get(id) {
  return RSocket.rr({
    route: `${base}.${id}`,
  });
}

export function update(channel) {
  return RSocket.rr({
    route: `${base}.update`,
    data: channel,
  });
}

export function create(channel) {
  return RSocket.rr({
    route: `${base}.create`,
    data: channel,
  });
}

export function remove(id) {
  return RSocket.rr({
    route: `${base}.${id}.delete`,
  });
}

/**
 * 完成指定退款申请第三方退款方退款
 * @param {*} channel 渠道类型
 * @param {*} applicationId  申请id
 * @returns
 */
export function completeOtherRefund(data) {
  return RSocket.rr({
    route: `${base}.complete.other.refund`,
    args: {
      ...data,
    },
  });
}

/**
 * 获取包车订单信息
 * @param {*} id
 * @returns
 */
export function getCcOrderInfo(id) {
  return RSocket.rr({
    route: `ccorders.${id}`,
  });
}

/**
 * 获取巴士订单信息
 * @param {*} id
 * @returns
 */
export function getBusOrderInfo(id) {
  return RSocket.rr({
    route: `busorders.${id}`,
  });
}

/**
 * 获取专线订单信息
 * @param {*} id
 * @returns
 */
export function getScOrderInfo(id) {
  return RSocket.rr({
    route: `scorders.${id}`,
  });
}

/**
 * 获取拼车订单信息
 * @param {*} id
 * @returns
 */
export function getRsOrderInfo(id) {
  return RSocket.rr({
    route: `rsorders.${id}`,
  });
}
